Code Example

Link to Control Module Code
Video A
Video B
/*
 * created 09/09.2015
 * by Brian Patton
 * modified xx/xx/xxxx
 * by xxxx
 * This code is in the public domain.
 */
//********************************************************
//    Global Variables
//********************************************************
#include<Servo.h>
Servo LServo;
Servo RServo;
// LEDs
int onboardLEDPin = 13;                    // for diagnostics
const int left_forward_fast = 2000;       // CCW Fast
const int left_forward_slow = 1650;
const int left_stop = 1500;               // Center position
const int left_backward_slow = 1350;
const int left_backward_fast = 1000;      // CW Fast

const int right_forward_fast = 1000;      // CW Fast
const int right_forward_slow = 1325;
const int right_stop = 1500;              // Center position
const int right_backward_slow = 1650;
const int right_backward_fast = 2000;      // CCW Fast

//********************************************************
//    Setup
//********************************************************
void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  LServo.attach(0);
  RServo.attach(1);
   pinMode(onboardLEDPin, OUTPUT);
    for (int i = 0; i < 3; i++) {
    digitalWrite(onboardLEDPin, HIGH);
    delay(500);
    digitalWrite(onboardLEDPin, LOW);
    delay(500);        
  }
}
//********************************************************
//    Main Loop
//********************************************************
void loop() {
  // call your functions here:
testSetup();
  while (true);       // pause code forever!
}
//********************************************************
//    testSetup
//********************************************************
void testSetup() {
    // test the servo motors
    forwardFast(575);
    backwardFast(575);
    StopBot(1000);
}